﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>工作日报查看</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
    <link href="../Frozenui1.3/css/frozen.css" rel="stylesheet" />
    <script src="../JS/zepto.min.js"></script>
    <script src="../Frozenui1.3/js/frozen.js"></script>
    <script src="/Scripts/avalon.min.js"></script>
    <script src="/Scripts/SZHLCommon.js"></script>
    <script>

        var strId = ComFunJS.getQueryString("ID");
        var gzrbinfo = avalon.define({
            $id: "gzrbinfo",
            modelData: {},
            plData: {},
            plcount:0

        });
        avalon.ready(function () {

            if (strId != null) {
                var lg = $.loading({
                    content: '加载中...',
                })
                $.getJSON('/API/WXAPI.ashx?Action=GETGZRZMODEL&r=' + Math.random(), { P1: strId }, function (resultData) {
                    lg.hide();
                    if (resultData.ErrorMsg == "") {
                        gzrbinfo.modelData = resultData.Result;
                        gzrbinfo.plData = resultData.Result1;
                        gzrbinfo.plcount = resultData.Result1.length;
                    }
                })
            }

            $(".ui-btn").click(function () {
                var lg = $.loading({
                    content: '加载中...',
                })
                $.getJSON('/API/WXAPI.ashx?Action=ADDCOMENT&r=' + Math.random(), { "P1": $("#content").val(), "MsgType": "GZRZ", "MsgLYID": strId }, function (resultData) {
                    lg.hide();
                    if (resultData.ErrorMsg == "") {
                        gzrbinfo.plData.push(resultData.Result);
                        gzrbinfo.plcount = gzrbinfo.plcount + 1;
                        var el = $.tips({
                            content: "评论成功！！",
                            stayTime: 2000,
                            type: "success"
                        })
                        $("#content").val("");
                    }
                    else {
                        var el = $.tips({
                            content: "评论失败！！",
                            stayTime: 2000,
                            type: "warn"
                        })
                    }
                })
            });
        })

        
        
    </script>
    <style>
        .ui-list > li {
            margin: 3px;
            padding-left: 15px;
        }
        span {
            width: 100%;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            -webkit-appearance: none;
            border: 0;
            background: 0 0;
            padding-left: 95px;
        }
        .ms-controller, [ms-controller] {
            display: none;
        }

    </style>
</head>
<body>
   <!--<header class="ui-header ui-header-stable ui-border-b">
        <i class="ui-icon-return" onclick="history.back(-1)"></i><h1>工作日报查看</h1>
   </header>-->


    <section >

        <div class="ui-form ui-border-t" ms-controller="gzrbinfo">
            <div class="ui-form-item ui-border-b ">
                <label>
                    类型
                </label>
                <span>{{modelData.Remark}}</span>
            </div>
            <div class="ui-form-item ui-border-b">
                <label>
                    时间
                </label>
                <span>{{modelData.RBDate|date("yyyy-MM-dd")}}</span>
            </div>
            <div class="ui-form-item ui-border-b" style="height:auto">
                <label>
                    内容
                </label>
                <span ms-html="modelData.RBContent"></span>
            </div>
            <div class="ui-form-item ui-border-b">
                <label>
                    完成情况
                </label>
                <span>{{modelData.RBWCQK}}</span>
            </div>
            <div class="ui-form" style="display:none;">
                <ul class="ui-grid-halve">
                    <li>
                        <div class="ui-grid-halve-img">
                            <span style="background-image:url(http://placeholder.qiniudn.com/290x160)"></span>
                        </div>
                    </li>
                </ul>

            </div>
            <div class="ui-form-item ui-border-b">
                <label>
                    评论区
                </label>
                <span>共 {{plcount}} 条评论</span>
            </div>
            <div class="ui-form ui-border-t" style="margin-bottom:44px">
                <ul class="ui-list ui-list-pure">
                    <li class="ui-border ui-label-list" ms-repeat-el="plData">
                        <div style="display: -webkit-box;">
                            <div class="ui-avatar-s">
                                <span style="background-image:url(../img/ava1.png)"></span>
                            </div>
                            <div class="ui-list-info">
                                <h4>{{el.CRUserName}}</h4>
                            </div>
                            <div class="ui-list-info">
                                <p>{{el.CRDate|date("yyyy-MM-dd HH:mm")}}</p>
                            </div>
                        </div>
                        <p class="ui-txt-justify" ms-html="el.MSGContent"></p>
                    </li>
                </ul>
            </div>
        </div>

        <div class="ui-footer ui-footer-stable ui-btn-group ui-border-t">
            <section class="ui-input-wrap ui-border-t" style="width:100%">
                <div class="ui-input ui-border-radius">
                    <input id="content" type="text" name="" value="" placeholder="我也说一句...">
                </div>
                <button class="ui-btn">评论</button>
            </section>
        </div>
    </section> 
</body>
</html>
